<?php session_start();?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta http-equiv="Content-Language" content="es">
        <meta name="Robots" content="all">
        <meta name="Distribution" content="global">
        <meta name="description" content="iRestauranting monitoriza las principales páginas sobre restauración, valoramos tu presencia en Internet, las opiniones de tus clientes y la actividad sobre tu restaurante">
        <link rel="icon" href="img/favicon.ico" type="image/x-icon" >
        <title>iRestauranting - Registrarme en iRestauranting</title>
        <link rel="stylesheet" media="all" href="../css/irestauranting.css" >
    	<link rel="stylesheet" media="screen and (max-width: 1023px)" href="../css/irestauranting_tablet.css" >
        <link rel="stylesheet" href="../css/magnific-popup.css" >	
        <script type="text/javascript" src="../js/modernizr.custom.28468.js"></script>
        <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" >
    	<link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
		<link rel="stylesheet" type="text/css" href="../css/token-input-facebook.css" />
</head>

<body>
	<div>
        <div id="resto_header">
        	<div id="header-center">
                <div style="float:left">
                	<a href="../index.html"><img src="../img/LogoHome.png" /></a>
                </div>
                <div style="margin-left:30px;float:left">
                 	<img src="../img/barra_header.png" />
                 </div>
                 <div style="margin-top:20px;margin-left:30px;float:left;">
                 	<a style="text-decoration: none;"  href="../como_funciona.html"><span style="color:#FFF" class="texto_span_16_bold">Cómo funciona</span></a>
                 </div>
                 <div style="margin-left:30px;float:left">
                 	<img src="../img/barra_header.png" />
                 </div>
                 <div  style="margin-top:20px;margin-left:30px;float:left">
                 	<a style="text-decoration: none;" href="../que_te_ofrecemos.html"><span style="color:#FFF" class="texto_span_16_bold">Qué te ofrecemos</span></a>
                 </div>
                 <div style="margin-left:30px;float:left">
                 	<img src="../img/barra_header.png" />
                 </div>
                 <div  style="margin-top:20px;margin-left:30px;float:left">
                 	<a id="contact_form_link" style="text-decoration: none;" href="#contact-popup"><span style="color:#FFF" class="texto_span_16_bold">Contacto</span></a>
                 </div>
             </div>
         </div>
         <div id="separador_header">
         </div>	
         <div style="clear:both" />
         <div id="container_login">
         	<div class="texto_30">Cambio de contraseña</div>
         	<div id="login" style="border-radius:10px;display:block;width:520px;padding:30px 0 30px;margin:auto">
            	<form id="form_login" style="padding:0px 150px 0px;color:#666" method="post" action="change_password_response.php">
                	<p>
                	&nbsp;Contraseña actual:<br/>
                    <input  style="height:30px;background:#EEE" type="password" name="current_pass" size="30" data-validation="server" data-validation-url="validate-input.php"/>
                	</p>
                    <p>
                	&nbsp;Contraseña nueva:<br/>
                    <input  style="height:30px;background:#EEE" type="password" name="pass_confirmation" data-validation="length" data-validation-length="min6" id="password1" size="30" data-validation-error-msg="La contraseña debe ser de 6 caracteres como mínimo"/>
                	</p>
                    <p>
                	&nbsp;Confirmación de contraseña nueva:<br/>
                    <input  style="height:30px;background:#EEE" type="password" name="pass" data-validation="confirmation" id="password2" size="30" data-validation-error-msg="La confirmación de contraseña no es correcta" />
                	</p>
                    
            		<a id="submit_login" href="javascript:submit()"><img style="display: block;margin: 0 auto;cursor:pointer;" src="../img/BotonAceptar.png" /></a>
                    <br/><br/>
                    
                    <br/><br/>
                </form>
            </div>
        </div>
        
     </div>
     <br><br>
	
    <div id="contact-popup" class="white-popup mfp-hide">
  			<form id="form_contact">
                <div id="resumen_envio" class="resumen_indicador_graph">
                            Contáctanos
                </div>  
                
                <div>
                    <span class="texto_form">Nombre:</span>
                    
                    <input style="display: inline-block;" type="text" name="name" id="name" size="40" />
                </div>
                <div>
                    <span class="texto_form">E-Mail:</span>
                    <input style="display: inline-block;" type="text" name="email" id="email" size="40" />
                </div>
                <div >
                    <span class="texto_form">Comentario:</span>
                    <textarea rows="10" cols="39" name="message" id="message"></textarea>
                </div>
                <div style="width:100%;">
            		<a id="submitButtonId"><img style="display: block;margin: 0 auto;cursor:pointer;" src="../img/enviar.png" /></a>
            	</div>
            </form>
	</div>
    <script src="../js/jquery-1.9.1.js" type="text/javascript"></script>
     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript" src="../js/jquery.tokeninput.js"></script>
	<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-form-validator/2.1.27/jquery.form-validator.min.js"></script>
    <script src="../js/jquery.magnific-popup.js"></script> 
	<script>
		$.validate(
		{
			modules : 'security',
			errorClass: "my-error-class",
			submitHandler: function(form){
				alert(1);
			}
		});
    </script>
    <script>
		function submit(){
				$("#form_login").submit();
		}
	</script>
    
    <script type="text/javascript">
			$(document).ready(function () {
				$.getJSON("user_management.php?check_login=1",
			 		function(data)
					{						
						if(data.logged == true){
							$("#name_complete").val(data.username_complete);
							$("#name").val(data.username);
							$("#email").val(data.username_email);
							
							var jsonArr = [];
							for(var i=0;i < data.restaurants.length; i++){
								$("#resto_search").tokenInput("add", {id: data.restaurants[i].id_resto , name: (data.restaurants[i].desc_resto + "(" + data.restaurants[i].address_resto + ")") });
							}
						}
					}
				);
    			$("#resto_search").tokenInput("../search_resto.php", { theme: "facebook", minChars: "2", hintText: "Busca el restaurante", noResultsText: "No hay resultados", searchingText: "Buscando..." })
			});
	</script>
    <script>
		// Carga del popup del contact form
		$('#contact_form_link2').magnificPopup({ 
			type:'inline',
  			midClick: true 
		});
			
		$("#submitButtonId").click(function() {
				
				
				var url = "../contact/contact_form.php"; // the script where you handle the form input.
			
				$.ajax({
					   type: "POST",
					   url: url,
					   data: $("#form_contact").serialize(), // serializes the form's elements.
					   success: function(data)
					   {
						  $.magnificPopup.open({
							  items: {
								src: '<div class="white-popup-thanks"><div class="resumen_indicador_graph">Muchas gracias por contactarnos.<br/><br/>Sus comentarios serán analizados por el equipo de iRestauranting</div></div>', 
								type: 'inline',
								midClick: true 
							  }
							});
						   
						 
					   }
					 });
			
				return false; // avoid to execute the actual submit of the form.
			});
	</script>
	 <script type="text/javascript">

		var _gaq = _gaq || [];
		_gaq.push(['_setAccount', 'UA-42707380-1']);
		_gaq.push(['_setDomainName', 'irestauranting.com']);
		_gaq.push(['_setDomainName', 'irestauranting.es']);
		_gaq.push(['_setAllowLinker', true]);
		_gaq.push(['_trackPageview']);

		(function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript';
		  ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 
		  'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0];
		  s.parentNode.insertBefore(ga, s);
		})();

</script>
</body>
</html>